<ul class="breadcrumb">
    <li><a href="/com/mods/list">我的Mod列表</a></li>
    <li><a href="/com/mods/list">{$modname}</a></li>
    <li><a href="/com/mods/desclist/{$modid}">{$version}</a></li>
    <li class="active">编辑【v{$version}】</li>
</ul>

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">操作</h3>
    </div>
    <div class="panel-body">
        <input type="button" id="sub" onclick="tijiao()" class="btn btn-primary" value="提交">
    </div>
</div>

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">版本</h3>
    </div>
    <div class="panel-body">
        <input type="text" id="modver" class="form-control" placeholder="1.0.0" value="{$version}">
    </div>
</div>

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">更新内容</h3>
    </div>
    <div class="panel-body">
        <div id="editor"></div>
    </div>
</div>

<script>
    var editor=loadEditor("editor",{height:400});
    editor.ready(function(){
        editor.setContent(Base64.decode('{$description}'));
    });
</script>
<script>
function tijiao(){
    Ajax("/com/api/mods/editdesc",{
        'id':{$id},
        'modver':$("#modver").val(),
        'desc':editor.getContent()
    },function(res){
        if(res.code==200){
            layer.msg("修改成功");
            setTimeout(function(){window.location.href="/com/mods/desclist/{$mid}"; },1500);
        }else{
            layer.msg(res.msg);
        }
    });
}
</script>